
CKEDITOR.dialog.add("insimgDialog", function(editor)
{
	return {
		title:"Insert an image",
		minWidth:400,
		minHeight:200,
		onOk:function()
		{
			//editor.insertText(data);
			//alert(document.getElementsByName("des").length);
			//alert(dwr.util.getValue("des"));
			if (document.getElementById("uploadImage").value !== "")
			{
				fileUploader.uploadImage
				(
					dwr.util.getValue("uploadImage"),
					document.getElementById("uploadImage").value,
					function(data)
					{
						editor.insertHtml("<img src='" + data + "' />");
					}
				);
			}
		},
		contents:
		[
			{
				id:"tab1",
				label:"Local",
				title:"Local",
				elements:
				[
					{
						type:"html",
						html:"<input type=\"file\" name=\"uploadImage\" class=\"cke_dialog_ui_file\" /><input type=\"button\" value=\"\u6e05\u7a7a\" onclick=\"dwr.util.setValue('uploadImage', '')\" class=\"cke_dialog_ui_button\" />"
					}
				]
			}
		]
	};
});

